<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('修改兼任人员信息')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<style>
    .select2 {
        width: 100% !important;
    }
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-retire-edit" AUTOCOMPLETE="OFF">
        <input name="id" id="id" type="hidden" th:value="${editEnd.id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label ">工号：</label>
            <div class="col-sm-8">
                <input class="form-control" id="badge" type="text" th:value="${editEnd.badge}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">姓名：</label>
            <div class="col-sm-8">
                <input class="form-control" id="name" type="text" th:value="${editEnd.name}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">公司名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="compName" type="text" th:value="${editEnd.compName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">部门名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="depName" type="text" th:value="${editEnd.depName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">岗位名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="jobName" type="text" th:value="${editEnd.jobName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">员工状态：</label>
            <div class="col-sm-8">
                <input class="form-control" id="empStatusName" type="text" th:value="${editEnd.empStatusName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">在岗状态：</label>
            <div class="col-sm-8">
                <input class="form-control" id="jobStatusName" type="text" th:value="${editEnd.jobStatusName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">入职日期：</label>
            <div class="col-sm-8">
                <input class="form-control" id="joinDate" type="text" th:value="${editEnd.joinDate}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">兼任公司名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="partCompIDTitle" type="text" th:value="${editEnd.partCompIDTitle}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">兼任部门名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="partDepIDTitle" type="text" th:value="${editEnd.partDepIDTitle}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">兼任工作岗位：</label>
            <div class="col-sm-8">
                <input class="form-control" id="partJobIDTitle" type="text" th:value="${editEnd.partJobIDTitle}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">兼任开始日期：</label>
            <div class="col-sm-8">
                <input class="form-control" id="beginDate" type="text" th:value="${editEnd.beginDate}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">兼任是否结束：</label>
            <div class="col-sm-8">
                <label class="toggle-switch switch-solid">
                    <input type="checkbox" id="isover" th:checked="${editEnd.isover}"
                           readonly="readonly">
                    <span></span>
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">兼任结束日期：</label>
            <div class="col-sm-8">
                <input class="form-control" name="endDate" id="endDate" type="text" th:value="${editEnd.endDate}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">兼任终止原因：</label>
            <div class="col-sm-8">
                <input class="form-control" name="reason" id="reason" type="text" th:value="${editEnd.reason}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">备注：</label>
            <div class="col-sm-8">
                <input class="form-control" name="remark" id="remark" type="text" th:value="${editEnd.remark}"/>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "changeManage/EmpConcurrentlyManage";

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '#endDate',
                type: 'date'
            });
        });
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-retire-edit").serializeArray();
            var endDate = $("#endDate").val();
            var reason = $("#reason").val();
            if (endDate == "" || endDate == null) {
                $.modal.alertWarning("请选择兼任结束日期!");
                return;
            }
            if (reason == "" || reason == null) {
                $.modal.alertWarning("请选择兼任终止原因!");
                return;
            }
            $.operate.save(prefix + "/editEnd", data);
        }
    }

</script>


</body>
</html>